package C031;

/**
 * ClassName: C01
 * Package: C031
 * Description:
 *
 * @Author BCXJ
 * @Create 2024/12/27 16:06
 * @Version 1.0
 * @Since 1.0
 */
public class Code01_PowerOfTwo {
    public static void main(String[] args) {
        System.out.println(powerOfTwo(12));
        System.out.println(powerOfTwo(8));
        System.out.println(powerOfTwo(32));
    }

    public static boolean powerOfTwo(int num) {
        return (num & (~num + 1)) == num;
    }
}
